import 'package:flutter/material.dart';

class GetClipper extends CustomClipper<Path> {
  dynamic path;

  GetClipper({this.path});

  @override
  Path getClip(Size size) {
    Path _path = Path();
    List _list = [[]];
    if (path is List) {
      _list = path;
    } else if (path is Function) {
      _list = path(size);
    }
    _path.moveTo(_list[0][0], _list[0][1]);
    for (int i = 1; i < _list.length; i++) {
      _path.lineTo(_list[i][0], _list[i][1]);
    }
    _path.close();
    return _path;
  }

  @override
  bool shouldReclip(covariant CustomClipper<Path> oldClipper) {
    return false;
  }
}
